package com.hjp;

import java.util.Scanner;

//字符串最后一个单词的长度
public class StringLong {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入单词");
        String str = sc.nextLine();
        String[] s = str.split(" ");
        for (int i = 0; i < s.length; i++) {
            String b = s[i];
            System.out.println(b);
        }
        System.out.println(s.length);
        System.out.println(s[s.length-1].length());

        System.out.println(str);

    }

}
